package org.example.Polls;

import java.util.Set;
import java.util.HashSet;

public class Poll {
	private Long id;
    private User administrator;
    private String title;
    private java.util.Date createDate;
    private java.util.Date startDate;
    private java.util.Date endDate;
    private Boolean publc;
    private Boolean dynamic;
    private Boolean anonymous;
    
    Set<PollItem> items = new HashSet<PollItem>();
    Set<PollParticipant> participants = new HashSet<PollParticipant>();
    
	/**
	 * @return the id
	 */
	public Long getId() {
		return id;
	}
	/**
	 * @param id the id to set
	 */
	public void setId(Long id) {
		this.id = id;
	}
	/**
	 * @return the administrator
	 */
	public User getAdministrator() {
		return administrator;
	}
	/**
	 * @param administrator the administrator to set
	 */
	public void setAdministrator(User administrator) {
		this.administrator = administrator;
	}
	/**
	 * @return the title
	 */
	public String getTitle() {
		return title;
	}
	/**
	 * @param title the title to set
	 */
	public void setTitle(String title) {
		this.title = title;
	}
	/**
	 * @return the createDate
	 */
	public java.util.Date getCreateDate() {
		return createDate;
	}
	/**
	 * @param createDate the createDate to set
	 */
	public void setCreateDate(java.util.Date createDate) {
		this.createDate = createDate;
	}
	/**
	 * @return the startDate
	 */
	public java.util.Date getStartDate() {
		return startDate;
	}
	/**
	 * @param startDate the startDate to set
	 */
	public void setStartDate(java.util.Date startDate) {
		this.startDate = startDate;
	}
	/**
	 * @return the endDate
	 */
	public java.util.Date getEndDate() {
		return endDate;
	}
	/**
	 * @param endDate the endDate to set
	 */
	public void setEndDate(java.util.Date endDate) {
		this.endDate = endDate;
	}
	/**
	 * @return the _public
	 */
	public Boolean getPublc() {
		return publc;
	}
	/**
	 * @param _public the _public to set
	 */
	public void setPublc(Boolean publc) {
		this.publc = publc;
	}
	/**
	 * @return the dynamic
	 */
	public Boolean getDynamic() {
		return dynamic;
	}
	/**
	 * @param dynamic the dynamic to set
	 */
	public void setDynamic(Boolean dynamic) {
		this.dynamic = dynamic;
	}
	/**
	 * @return the anonymous
	 */
	public Boolean getAnonymous() {
		return anonymous;
	}
	/**
	 * @param anonymous the anonymous to set
	 */
	public void setAnonymous(Boolean anonymous) {
		this.anonymous = anonymous;
	}
	/**
	 * @return the items
	 */
	public Set<PollItem> getItems() {
		return items;
	}
	/**
	 * @param items the items to set
	 */
	public void setItems(Set<PollItem> items) {
		this.items = items;
	}
	/**
	 * @return the participants
	 */
	public Set<PollParticipant> getParticipants() {
		return participants;
	}
	/**
	 * @param participants the participants to set
	 */
	public void setParticipants(Set<PollParticipant> participants) {
		this.participants = participants;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((title == null) ? 0 : title.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Poll other = (Poll) obj;
		if (title == null) {
			if (other.title != null)
				return false;
		} else if (!title.equals(other.title))
			return false;
		return true;
	}

    /**
     * Set properties on this object by parsing the provided XML
     */
    
}
